import SvBase from "./SvBase";

export default class PreView extends SvBase {

  style = {
    padding: "14px",
    "border": "6px solid #ccc!important",
    "border-color": "#2196F3!important",
    "display": "inline-block"
  };

  canvas;

  init() {
    this.canvas.on('change.windowSize', this.changeSize)
  }

  changeSize(w, h) {
    if (h < 200) {
      h = 200;
    }
    if (w < 900) {
      if (w < 600) {
        w = 600;
      }
      this.style.width = w * 2 / 3 + 'px';
    } else {
      this.style.width = w - 320 + 'px';
    }
    this.style.height = (h - 100) + 'px';
    this.update()
  }


};
